package tinybase.sm;

import java.nio.ByteBuffer;

import junit.framework.Assert;

import tinybase.basic.RedBase;

public class Value {

	public RedBase.AttrType attrType;
	public Object pData;

	public Value(RedBase.AttrType _attrType, Object data) {
		attrType = _attrType;
		pData = data;
	}

	@Override
	public String toString() {
		String tmp = "Value [attrType=" + attrType + ", pData=";
		switch (attrType) {
		case INT:
			tmp += ((Integer)pData).intValue();
			break;
		case FLOAT:
			tmp += ((Float)pData).floatValue();
			break;
		case STRING:
			tmp += (String)pData;
			break;
		default:
			Assert.assertTrue(false);
		}
		tmp += "]";
		return tmp;
	}

}
